<!-- 
Search Item (keyword)
- description

Bid item 
- view item, current price, end time

Results:
item (click to view list of bidders/status), seller (click to view rating/comment page), start time, end time, base price, current price, current winner, bid button)
Monitor auctions in real time (who is bidding)

Activity History (same as Results)

Rating / check seller rating + comments (real time, sorted by posting time)

Recommendation
 -->

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/minified/jquery-ui.min.css" type="text/css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script>

	//setInterval(realTimeComment, 5000);
	
	function realTimeComment(){
		$('#commentTable').html("");
		//get rating!
        $.get('/viewRating',{},function(response) { 
      	  $("#rating").text(response);  
        });
    	    	
    	$.get('/viewComment',{},function(response) { 
    		            
            var json= jQuery.parseJSON(response);
            if (json.length==0){
         	   $(table).append($('<td>').text("No comments so far!!"));
         	   
            }else{
         	   
         	  var table = $('#commentTable');
         	  
         	  $('<tr>').appendTo(table)  
  	            .append($('<td>').text("Author"))
  	            .append($('<td>').text("post date"))
  	            .append($('<td>').text("comment"));
  	            
         	  $.each(json, function (i, element) {
            	   var row=$('<tr>');   
    	            row.append($('<td>').text(element.buyerId))
    	            .append($('<td>').text(element.dateCreated))
    	            .append($('<td>').text(element.content));
    	            $(table).append(row);
            	  });
            }
      	}); 
	}

    $(document).ready(function() {  
    	
    	realTimeComment();
    });


</script>

<title>My Rating</title>
<!-- <link href="Site.css" rel="Stylesheet" type="text/css"/>
 -->
 </head>
  <body>


<div id="container" >
                <h1>My Rating (out of 10):</h1> 
                <h2><div id="rating" name="rating" /></h2>
                
                <h1>My Comments:</h1> 
                <p > 
                    <table border="1" id="commentTable"></table>
                </p>
  
</div>  
<A HREF="javascript:history.back()">Back</A>


  </body>
</html>